package tr.edu.metu.is.mega.common.dto;

import java.util.Date;

import javax.validation.constraints.Future;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * Data structure class for users.
 */
public class UserDTO extends BaseDTO {

    private static final long serialVersionUID = 7177123587671321862L;

    public static final String FIELD_EMAIL = "email";

    public static final String FIELD_EXPIRYDATE = "expiryDate";

    public static final String FIELD_IDENTIFICATIONNO = "identificationNo";

    public static final String FIELD_NAME = "name";

    public static final String FIELD_SURNAME = "surname";

    public static final String FIELD_PASSWORD = "password";

    public static final String FIELD_PHOTO = "photo";

    public static final String FIELD_USERNAME = "userName";

    public static final String FIELD_ROLE = "role";

    public static final String FIELD_FULL_NAME = "fullName";

    @Size(max = 50)
    @NotNull
    private String email;

    @Future
    private Date expiryDate;

    @Size(max = 10)
    private String identificationNo;

    @Size(max = 20)
    private String name;

    @NotNull
    @Size(min = 5, max = 20)
    private String password;

    private String photo;

    @Size(max = 20)
    private String surname;

    @NotNull
    @Size(min = 5, max = 50)
    private String userName;

    @NotNull
    private UserRole role;

    /**
     * Default constructor.
     */
    public UserDTO() {
    }

    /**
     * Returns email.
     * 
     * @return the email
     */
    public String getEmail() {
        return email;
    }

    /**
     * Sets email value.
     * 
     * @param email the email to set
     */
    public void setEmail(String email) {
        this.email = email;
    }

    /**
     * Returns expiryDate.
     * 
     * @return the expiryDate
     */
    public Date getExpiryDate() {
        return expiryDate;
    }

    /**
     * Sets expiryDate value.
     * 
     * @param expiryDate the expiryDate to set
     */
    public void setExpiryDate(Date expiryDate) {
        this.expiryDate = expiryDate;
    }

    /**
     * Returns identificationNo.
     * 
     * @return the identificationNo
     */
    public String getIdentificationNo() {
        return identificationNo;
    }

    /**
     * Sets identificationNo value.
     * 
     * @param identificationNo the identificationNo to set
     */
    public void setIdentificationNo(String identificationNo) {
        this.identificationNo = identificationNo;
    }

    /**
     * Returns name.
     * 
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * Sets name value.
     * 
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * Returns password.
     * 
     * @return the password
     */
    public String getPassword() {
        return password;
    }

    /**
     * Sets password value.
     * 
     * @param password the password to set
     */
    public void setPassword(String password) {
        this.password = password;
    }

    /**
     * Returns photo.
     * 
     * @return the photo
     */
    public String getPhoto() {
        return photo;
    }

    /**
     * Sets photo value.
     * 
     * @param photo the photo to set
     */
    public void setPhoto(String photo) {
        this.photo = photo;
    }

    /**
     * Returns surname.
     * 
     * @return the surname
     */
    public String getSurname() {
        return surname;
    }

    /**
     * Sets surname value.
     * 
     * @param surname the surname to set
     */
    public void setSurname(String surname) {
        this.surname = surname;
    }

    /**
     * Returns userName.
     * 
     * @return the userName
     */
    public String getUserName() {
        return userName;
    }

    /**
     * Sets userName value.
     * 
     * @param userName the userName to set
     */
    public void setUserName(String userName) {
        this.userName = userName;
    }

    /**
     * Returns role.
     * 
     * @return the role
     */
    public UserRole getRole() {
        return role;
    }

    /**
     * Sets role value.
     * 
     * @param role the role to set
     */
    public void setRole(UserRole role) {
        this.role = role;
    }

    /**
     * Returns name + surname
     * 
     * @return name + surname
     */
    public String getFullName() {
        return name + " " + surname;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return name + " " + surname;
    }

}
